import { axios } from "../../utils/request";

const api = {
    code: "/in/inventoryCheck/getCode",//获取盘存单据编码
    page: "/in/inventoryCheck/getOneByCondition",//翻页

    first: "/in/inventoryCheck/firstExamine",//复核
    second: "/in/inventoryCheck/secondExamine",//审核(监盘)
    third: "/in/inventoryCheck/thirdExamine",//批准

    save: "/in/inventoryCheck/save",//保存
    delete: "/in/inventoryCheck/delete",//删除盘存表
    inventory: "/in/inventoryInfo/pageInInventoryCheckSearchVo", //盘点业务 查询现存量

    list: "/in/inventoryCheck/pageVInventoryCheckMain",//盘存列表
};


/**
* 获取盘存单据编码
*/
export function getCodeApi(data) {
    return axios({
        url: api.code,
        method: "get",
        params: data,
    });
}


/**
 * 保存
 * @param {*} data
 */
export function saveApi(data) {
    return axios({
        url: api.save,
        method: "post",
        data: data
    });
}

/**
 * 删除
 */
export function deleteApi(id) {
    return axios({
        url: api.delete,
        method: "delete",
        params: id
    });
}

/**
* 翻页
*/
export function pageApi(data) {
    return axios({
        url: api.page,
        method: "get",
        params: data,
    });
}

/**
* 复核
*/
export function firstExamineApi(data) {
    return axios({
        url: api.first,
        method: "get",
        params: data,
    });
}

/**
* 审核
*/
export function secondExamineApi(data) {
    return axios({
        url: api.second,
        method: "get",
        params: data,
    });
}

/**
* 列表
*/
export function listSearchApi(data) {
    return axios({
        url: api.list,
        method: "get",
        params: data,
    });
}
/**
 * 获取物料列表
 */
export function getInventory(data) {
    return axios({
        url: api.inventory,
        method: "get",
        params: data,
    });
}

/**
 * 批准
 */
export function thirdExamineApi(data) {
    return axios({
        url: api.third,
        method: "get",
        params: data,
    });
}


